package demo01;
//本节课作业
//这个文件不确定是否正确
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("1.html");
        byte [] buffer = new byte[1024];

        int bytesRead;

        while ((bytesRead= fileInputStream.read(buffer))!=-1);
        String content = new String(buffer,0,bytesRead);
        System.out.println(content);

        String data = "劳动节快乐";
        FileOutputStream fileOutputStream = new FileOutputStream("1.html");
        byte []bytes = data.getBytes();
        fileOutputStream.write(bytes);
    }
}
